﻿#if SILVERLIGHT
using System;
using System.Diagnostics.Contracts;

namespace Postnuclear
  {
  /// <summary>
  /// Provides data for the <see cref="INotifyPropertyChanging.PropertyChanging" /> event.
  /// </summary>
  public sealed class PropertyChangingEventArgs : EventArgs
    {
    #region Public

    // Constructors

    /// <summary>
    /// Initializes a new instance of the <see cref="PropertyChangingEventArgs"/> class.
    /// </summary>
    /// <param name="propertyName">The name of the property whose value is changing.</param>
    public PropertyChangingEventArgs(string propertyName)
      {
      Contract.Requires<ArgumentNullException>(propertyName.HasSense());
      Contract.Ensures(PropertyName == propertyName);

      _propertyName = propertyName;
      }

    // Properties

    /// <summary>
    /// Gets the name of the property whose value is changing.
    /// </summary>
    /// <value>
    /// The name of the property whose value is changing.
    /// </value>
    public string PropertyName
      {
      get
        {
        return _propertyName;
        }
      }

    #endregion

    #region Private

    // Fields

    private readonly string _propertyName;

    #endregion
    }
  }

#endif